package com.tz.mybatis.generator.plugins;

import java.util.List;

import org.mybatis.generator.api.IntrospectedColumn;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.Plugin;
import org.mybatis.generator.api.PluginAdapter;
import org.mybatis.generator.api.dom.java.Field;
import org.mybatis.generator.api.dom.java.Interface;
import org.mybatis.generator.api.dom.java.Method;
import org.mybatis.generator.api.dom.java.Parameter;
import org.mybatis.generator.api.dom.java.TopLevelClass;

/**
 * 自定义注释生成插件
 * 
 * @author yishui
 * @date 2018年7月13日
 * @version 0.0.1
 */
public class CommentGeneratorPlugin extends PluginAdapter {
	public boolean validate(List<String> warnings) {
		return true;
	}

	public boolean modelBaseRecordClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();

		topLevelClass.addJavaDocLine("/**");
		sb.append(" * @ClassName: ");
		sb.append(topLevelClass.getType().getShortName());
		topLevelClass.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: ");
		sb.append(introspectedTable.getFullyQualifiedTable());
		sb.append("表对应的java bean类");
		topLevelClass.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @author: yishui zhiyubujian@163.com");
		topLevelClass.addJavaDocLine(sb.toString());

		topLevelClass.addJavaDocLine(" */");

		return true;
	}

	public boolean modelPrimaryKeyClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();

		topLevelClass.addJavaDocLine("/**");
		sb.append(" * @ClassName: ");
		sb.append(topLevelClass.getType().getShortName());
		topLevelClass.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: ");
		sb.append(introspectedTable.getFullyQualifiedTable());
		sb.append("表对应的java bean主键类");
		topLevelClass.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @author: yishui zhiyubujian@163.com");
		topLevelClass.addJavaDocLine(sb.toString());

		topLevelClass.addJavaDocLine(" */");

		return true;
	}

	public boolean clientGenerated(Interface interfaze, TopLevelClass topLevelClass,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();

		interfaze.addJavaDocLine("/**");
		sb.append(" * @ClassName: ");
		sb.append(interfaze.getType().getShortName());
		interfaze.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: ");
		sb.append(introspectedTable.getFullyQualifiedTable());
		sb.append("表对应的dao操作Mapper映射类");
		interfaze.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @author: yishui zhiyubujian@163.com");
		interfaze.addJavaDocLine(sb.toString());

		interfaze.addJavaDocLine(" */");

		return true;
	}

	public boolean modelFieldGenerated(Field field, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn,
			IntrospectedTable introspectedTable, ModelClassType modelClassType) {
		StringBuilder sb = new StringBuilder();

		field.addJavaDocLine("/**");
		sb.append(" * @Fields ");
		sb.append(introspectedTable.getFullyQualifiedTable());
		sb.append('.');
		sb.append(introspectedColumn.getActualColumnName());
		sb.append(" :");
		sb.append(introspectedColumn.getRemarks());
		field.addJavaDocLine(sb.toString());

		field.addJavaDocLine(" */");
		return true;
	}

	public boolean modelGetterMethodGenerated(Method method, TopLevelClass topLevelClass,
			IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable,
			ModelClassType modelClassType) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append(" * @return ");
		sb.append(introspectedTable.getFullyQualifiedTable());
		sb.append('.');
		sb.append(introspectedColumn.getActualColumnName());
		sb.append(" : 返回 ");
		sb.append(introspectedColumn.getRemarks());
		method.addJavaDocLine(sb.toString());
		method.addJavaDocLine(" */");
		return true;
	}

	public boolean modelSetterMethodGenerated(Method method, TopLevelClass topLevelClass,
			IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable,
			ModelClassType modelClassType) {
		StringBuilder sb = new StringBuilder();

		method.addJavaDocLine("/**");
		sb.append(" * @param ");
		sb.append(((Parameter) method.getParameters().get(0)).getName());
		sb.append(" of ");
		sb.append(introspectedTable.getFullyQualifiedTable());
		sb.append(" : 设置 ");
		sb.append(introspectedColumn.getRemarks());
		method.addJavaDocLine(sb.toString());
		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientCountByExampleMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());

		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据查询条件，计算" + introspectedTable.getFullyQualifiedTable() + "个数");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param example 通用查询条件类");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int 结果个数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientDeleteByExampleMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据查询条件，删除" + introspectedTable.getFullyQualifiedTable());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param example 通用查询条件类");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int  删除个数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientDeleteByPrimaryKeyMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据属性名称，删除" + introspectedTable.getFullyQualifiedTable());
		method.addJavaDocLine(sb.toString());
		List<Parameter> params = method.getParameters();
		for (int i = 0; i < params.size(); ++i) {
			Parameter p = (Parameter) params.get(i);
			sb = new StringBuilder();
			sb.append("* @param " + p.getName() + " " + p.getName());
			method.addJavaDocLine(sb.toString());
		}

		sb = new StringBuilder();
		sb.append("* @return int  删除个数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientInsertMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 插入一个" + introspectedTable.getFullyQualifiedTable());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param record " + introspectedTable.getFullyQualifiedTable() + "的bean对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int  插入个数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientInsertSelectiveMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 插入一个只有部分字段的" + introspectedTable.getFullyQualifiedTable());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param record 只含部分字段的" + introspectedTable.getFullyQualifiedTable() + "的bean对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int  插入个数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientSelectByExampleWithoutBLOBsMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());

		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据查询条件类，返回" + introspectedTable.getFullyQualifiedTable() + "结果集");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param example 通用查询条件类");
		method.addJavaDocLine(sb.toString());

		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");
		sb = new StringBuilder();
		sb.append("* @return List<" + tableName + ">" + introspectedTable.getFullyQualifiedTable() + "结果集");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientSelectByPrimaryKeyMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据主键类，返回" + introspectedTable.getFullyQualifiedTable());
		method.addJavaDocLine(sb.toString());
		List<Parameter> params = method.getParameters();
		for (int i = 0; i < params.size(); ++i) {
			Parameter p = (Parameter) params.get(i);
			sb = new StringBuilder();
			sb.append("* @param " + p.getName() + " " + p.getName());
			method.addJavaDocLine(sb.toString());
		}
		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");

		sb = new StringBuilder();
		sb.append("* @return " + tableName + " bean对象");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientUpdateByExampleSelectiveMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据查询条件更新" + introspectedTable.getFullyQualifiedTable() + "部分字段");
		method.addJavaDocLine(sb.toString());

		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");

		sb = new StringBuilder();
		sb.append("* @param record 要更新成为的" + tableName + "对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param example 更新记录的查询条件");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int 更新记录数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientUpdateByExampleWithoutBLOBsMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据查询条件更新" + introspectedTable.getFullyQualifiedTable() + "全表字段");
		method.addJavaDocLine(sb.toString());

		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");

		sb = new StringBuilder();
		sb.append("* @param record 要更新成为的" + tableName + "对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param example 更新记录的查询条件");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int 更新记录数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientUpdateByPrimaryKeySelectiveMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据主键更新" + introspectedTable.getFullyQualifiedTable() + "部分字段");
		method.addJavaDocLine(sb.toString());

		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");

		sb = new StringBuilder();
		sb.append("* @param record 要更新成为的" + tableName + "对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int 更新记录数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated(Method method, TopLevelClass interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据主键更新" + introspectedTable.getFullyQualifiedTable() + "全部字段");
		method.addJavaDocLine(sb.toString());

		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");

		sb = new StringBuilder();
		sb.append("* @param record 要更新成为的" + tableName + "对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int 更新记录数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientCountByExampleMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());

		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据查询条件，计算" + introspectedTable.getFullyQualifiedTable() + "个数");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param example 通用查询条件类");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int 结果个数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientDeleteByExampleMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据查询条件，删除" + introspectedTable.getFullyQualifiedTable());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param example 通用查询条件类");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int  删除个数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientDeleteByPrimaryKeyMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据属性名称，删除" + introspectedTable.getFullyQualifiedTable());
		method.addJavaDocLine(sb.toString());
		List<Parameter> params = method.getParameters();
		for (int i = 0; i < params.size(); ++i) {
			Parameter p = (Parameter) params.get(i);
			sb = new StringBuilder();
			sb.append("* @param " + p.getName() + " " + p.getName());
			method.addJavaDocLine(sb.toString());
		}

		sb = new StringBuilder();
		sb.append("* @return int  删除个数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientInsertMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 插入一个" + introspectedTable.getFullyQualifiedTable());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param record " + introspectedTable.getFullyQualifiedTable() + "的bean对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int  插入个数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientInsertSelectiveMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 插入一个只有部分字段的" + introspectedTable.getFullyQualifiedTable());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param record 只含部分字段的" + introspectedTable.getFullyQualifiedTable() + "的bean对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int  插入个数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientSelectByExampleWithoutBLOBsMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());

		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据查询条件类，返回" + introspectedTable.getFullyQualifiedTable() + "结果集");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param example 通用查询条件类");
		method.addJavaDocLine(sb.toString());

		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");
		sb = new StringBuilder();
		sb.append("* @return List<" + tableName + ">" + introspectedTable.getFullyQualifiedTable() + "结果集");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientSelectByPrimaryKeyMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据主键类，返回" + introspectedTable.getFullyQualifiedTable());
		method.addJavaDocLine(sb.toString());
		List<Parameter> params = method.getParameters();
		for (int i = 0; i < params.size(); ++i) {
			Parameter p = (Parameter) params.get(i);
			sb = new StringBuilder();
			sb.append("* @param " + p.getName() + " " + p.getName());
			method.addJavaDocLine(sb.toString());
		}
		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");

		sb = new StringBuilder();
		sb.append("* @return " + tableName + " bean对象");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientUpdateByExampleSelectiveMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据查询条件更新" + introspectedTable.getFullyQualifiedTable() + "部分字段");
		method.addJavaDocLine(sb.toString());

		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");

		sb = new StringBuilder();
		sb.append("* @param record 要更新成为的" + tableName + "对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param criteria 更新记录的查询条件");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int 更新记录数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientUpdateByExampleWithoutBLOBsMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据查询条件更新" + introspectedTable.getFullyQualifiedTable() + "全表字段");
		method.addJavaDocLine(sb.toString());

		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");

		sb = new StringBuilder();
		sb.append("* @param record 要更新成为的" + tableName + "对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @param criteria 更新记录的查询条件");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int 更新记录数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientUpdateByPrimaryKeySelectiveMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据主键更新" + introspectedTable.getFullyQualifiedTable() + "部分字段");
		method.addJavaDocLine(sb.toString());

		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");

		sb = new StringBuilder();
		sb.append("* @param record 要更新成为的" + tableName + "对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int 更新记录数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}

	public boolean clientUpdateByPrimaryKeyWithoutBLOBsMethodGenerated(Method method, Interface interfaze,
			IntrospectedTable introspectedTable) {
		StringBuilder sb = new StringBuilder();
		method.addJavaDocLine("/**");
		sb.append("* @Title ");
		sb.append(interfaze.getType().getShortName());
		sb.append(".");
		sb.append(method.getName());
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @Description: 根据主键更新" + introspectedTable.getFullyQualifiedTable() + "全部字段");
		method.addJavaDocLine(sb.toString());

		String pojoUrl = this.context.getJavaModelGeneratorConfiguration().getTargetPackage();
		String table = introspectedTable.getBaseRecordType();
		String tableName = table.replaceAll(pojoUrl + ".", "");

		sb = new StringBuilder();
		sb.append("* @param record 要更新成为的" + tableName + "对象");
		method.addJavaDocLine(sb.toString());

		sb = new StringBuilder();
		sb.append("* @return int 更新记录数");
		method.addJavaDocLine(sb.toString());

		method.addJavaDocLine(" */");
		return true;
	}
}